public class Test {
    public static void main(String[] args) {
//        求1-5的阶乘之和

        int j = 1;
        int sum = 0;
        while (j <= 5){

            int i = 1;
            int ret = 1;
            while (i <= j){
                ret *= i;
                i++;
            }
            j++;
            sum += ret;
//            System.out.println(ret);
        }
        System.out.println(sum);



    }
}
